home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / share / gtksourceview-2.0 / language-specs / java.lang < prev    next >
Extensible Markup Language  |  2009-10-02  |  7KB  |  209 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.  
  4.  Author: Gustavo Gir├íldez <gustavo.giraldez@gmx.net>
  5.  Copyright (C) 2003 Gustavo Gir├íldez <gustavo.giraldez@gmx.net>
  6.  Copyright (C) 2006 Jeff Walden <jwalden@mit.edu>
  7.  
  8.  This library is free software; you can redistribute it and/or
  9.  modify it under the terms of the GNU Library General Public
  10.  License as published by the Free Software Foundation; either
  11.  version 2 of the License, or (at your option) any later version.
  12.  
  13.  This library is distributed in the hope that it will be useful,
  14.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.  Library General Public License for more details.
  17.  
  18.  You should have received a copy of the GNU Library General Public
  19.  License along with this library; if not, write to the
  20.  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  21.  Boston, MA 02111-1307, USA.
  22.  
  23. -->
  24. <language id="java" _name="Java" version="2.0" _section="Sources">
  25.   <metadata>
  26.     <property name="mimetypes">text/x-java</property>
  27.     <property name="globs">*.java</property>
  28.     <property name="line-comment-start">//</property>
  29.     <property name="block-comment-start">/*</property>
  30.     <property name="block-comment-end">*/</property>
  31.   </metadata>
  32.  
  33.   <styles>
  34.     <style id="comment" _name="Comment" map-to="def:comment"/>
  35.     <style id="error" _name="Error" map-to="def:error"/>
  36.     <style id="escaped-character" _name="Escaped Character" map-to="def:special-char"/>
  37.     <style id="string" _name="String" map-to="def:string"/>
  38.     <style id="char" _name="Character" map-to="def:character"/>
  39.     <style id="external" _name="External" map-to="def:preprocessor"/>
  40.     <style id="declaration" _name="Declaration" map-to="def:type"/>
  41.     <style id="storage-class" _name="Storage Class" map-to="def:type"/>
  42.     <style id="scope-declaration" _name="Scope Declaration" map-to="def:type"/>
  43.     <style id="keyword" _name="Keyword" map-to="def:keyword"/>
  44.     <style id="null-value" _name="Null Value" map-to="def:special-constant"/>
  45.     <style id="boolean" _name="Boolean value" map-to="def:boolean"/>
  46.     <style id="number" _name="Number" map-to="def:decimal"/>
  47.     <style id="reserved" _name="Future Reserved Keywords" map-to="def:error"/>
  48.     <style id="type" _name="Data Type" map-to="def:type"/>
  49.   </styles>
  50.  
  51.   <definitions>
  52.  
  53.     <define-regex id="escaped-character" extended="true">
  54.       \\(               # leading backslash
  55.       [\\\"\'nrbtf] |   # escaped character
  56.       [0-9]{1,3}    |   # latin encoded char
  57.       u[0-9]{1,4}       # unicode char
  58.       )
  59.     </define-regex>
  60.  
  61.     <context id="string" style-ref="string" end-at-line-end="true">
  62.       <start>"</start>
  63.       <end>"</end>
  64.       <include>
  65.         <context id="escaped-character" style-ref="escaped-character">
  66.           <match>\%{escaped-character}</match>
  67.         </context>
  68.       </include>
  69.     </context>
  70.  
  71.    <context id="char" style-ref="char">
  72.      <match>'(\%{escaped-character}|.)'</match>
  73.    </context>
  74.  
  75.     <context id="line-comment" style-ref="comment" end-at-line-end="true">
  76.       <start>//</start>
  77.       <include>
  78.         <context ref="def:in-line-comment"/>
  79.       </include>
  80.     </context>
  81.  
  82.     <context id="block-comment" style-ref="comment">
  83.       <start>/\*</start>
  84.       <end>\*/</end>
  85.       <include>
  86.         <context ref="def:in-comment"/>
  87.       </include>
  88.     </context>
  89.  
  90.     <context id="close-comment-outside-comment" style-ref="error">
  91.       <match>\*/(?!\*)</match>
  92.     </context>
  93.  
  94.     <context id="externals" style-ref="external">
  95.       <keyword>import</keyword>
  96.       <keyword>package</keyword>
  97.     </context>
  98.  
  99.     <context id="declarations" style-ref="declaration">
  100.       <keyword>class</keyword>
  101.       <keyword>enum</keyword>
  102.       <keyword>extends</keyword>
  103.       <keyword>implements</keyword>
  104.       <keyword>instanceof</keyword>
  105.       <keyword>interface</keyword>
  106.       <keyword>native</keyword>
  107.       <keyword>throws</keyword>
  108.     </context>
  109.  
  110.     <context id="primitive-types" style-ref="type">
  111.       <keyword>boolean</keyword>
  112.       <keyword>byte</keyword>
  113.       <keyword>char</keyword>
  114.       <keyword>double</keyword>
  115.       <keyword>float</keyword>
  116.       <keyword>int</keyword>
  117.       <keyword>long</keyword>
  118.       <keyword>short</keyword>
  119.       <keyword>void</keyword>
  120.     </context>
  121.  
  122.     <context id="storage-class" style-ref="storage-class">
  123.       <keyword>abstract</keyword>
  124.       <keyword>final</keyword>
  125.       <keyword>static</keyword>
  126.       <keyword>strictfp</keyword>
  127.       <keyword>synchronized</keyword>
  128.       <keyword>transient</keyword>
  129.       <keyword>volatile</keyword>
  130.     </context>
  131.  
  132.     <context id="scope-declarations" style-ref="scope-declaration">
  133.       <keyword>private</keyword>
  134.       <keyword>protected</keyword>
  135.       <keyword>public</keyword>
  136.     </context>
  137.  
  138.     <context id="flow" style-ref="keyword">
  139.       <keyword>assert</keyword>
  140.       <keyword>break</keyword>
  141.       <keyword>case</keyword>
  142.       <keyword>catch</keyword>
  143.       <keyword>continue</keyword>
  144.       <keyword>default</keyword>
  145.       <keyword>do</keyword>
  146.       <keyword>else</keyword>
  147.       <keyword>finally</keyword>
  148.       <keyword>for</keyword>
  149.       <keyword>if</keyword>
  150.       <keyword>return</keyword>
  151.       <keyword>throw</keyword>
  152.       <keyword>switch</keyword>
  153.       <keyword>try</keyword>
  154.       <keyword>while</keyword>
  155.     </context>
  156.  
  157.     <context id="memory" style-ref="keyword">
  158.       <keyword>new</keyword>
  159.       <keyword>super</keyword>
  160.       <keyword>this</keyword>
  161.     </context>
  162.  
  163.     <context id="future-reserved-words" style-ref="reserved">
  164.       <keyword>const</keyword>
  165.       <keyword>goto</keyword>
  166.     </context>
  167.  
  168.     <context id="null-value" style-ref="null-value">
  169.       <keyword>null</keyword>
  170.     </context>
  171.  
  172.     <context id="boolean" style-ref="boolean">
  173.       <keyword>false</keyword>
  174.       <keyword>true</keyword>
  175.     </context>
  176.  
  177.     <context id="numeric" style-ref="number">
  178.       <match extended="true">
  179.         (\b([0-9]+|0[xX][0-9a-fA-F]+)[Ll]?\b|
  180.          \b(([0-9]+[Ee][-]?[0-9]+|
  181.             ([0-9]*\.[0-9]+|[0-9]+\.)([Ee][-]?[0-9]+)?)[fFdD]?|
  182.             [0-9]+[FfDd]))
  183.       </match>
  184.     </context>
  185.  
  186.     <context id="java">
  187.       <include>
  188.         <context ref="string"/>
  189.         <context ref="char"/>
  190.         <context ref="line-comment"/>
  191.         <context ref="block-comment"/>
  192.         <context ref="close-comment-outside-comment"/>
  193.         <context ref="externals"/>
  194.         <context ref="declarations"/>
  195.         <context ref="primitive-types"/>
  196.         <context ref="storage-class"/>
  197.         <context ref="scope-declarations"/>
  198.         <context ref="flow"/>
  199.         <context ref="memory"/>
  200.         <context ref="future-reserved-words"/>
  201.         <context ref="null-value"/>
  202.         <context ref="boolean"/>
  203.         <context ref="numeric"/>
  204.       </include>
  205.     </context>
  206.  
  207.   </definitions>
  208. </language>
  209.